package com.lxx.onlineview.results;

public class CodeMsg {

    private int code;
    private String msg;

    //通用的错误码 5001XX
    public static CodeMsg SUCCESS = new CodeMsg(0, "成功");
    public static CodeMsg SERVER_ERROR = new CodeMsg(500100, "服务端异常");
    public static CodeMsg REQUEST_ILLEGAL = new CodeMsg(500102, "请求非法");
    public static CodeMsg ACCESS_FREQUENT = new CodeMsg(500104, "访问太频繁");

    // 登录模块 5002XX
    public static CodeMsg USERNAME_NOT_EXIST = new CodeMsg(500200, "用户名不存在");
    public static CodeMsg PASSWORD_ERROR = new CodeMsg(500201, "密码错误");
    public static CodeMsg NOT_LOGIN = new CodeMsg(500202, "未登录");

    // 注册模块 5003XX
    public static CodeMsg USER_NAME_HAS_EXIST= new CodeMsg(500300, "用户名已存在,请选择其他用户名");

    public static CodeMsg NOT_EXIST = new CodeMsg(500400,"所查找信息不存在");
    public static CodeMsg ADD_FAIL = new CodeMsg(500401,"添加失败");
    public static CodeMsg UPDATE_FAIL = new CodeMsg(500402,"更新失败");
    public static CodeMsg DELETE_FAIL = new CodeMsg(500403,"删除失败");
    public static CodeMsg File_FAIL = new CodeMsg(500404,"文件存储失败");

    private CodeMsg(int code, String msg ) {
        this.code = code;
        this.msg = msg;
    }

    @Override
    public String toString() {
        return "CodeMsg [code=" + code + ", msg=" + msg + "]";
    }


    public int getCode() {
        return code;
    }
    public void setCode(int code) {
        this.code = code;
    }
    public String getMsg() {
        return msg;
    }
    public void setMsg(String msg) {
        this.msg = msg;
    }

}
